package main

import "fmt"

func main() {
	s := "hello"
	c := []byte(s)  // 将字符串转为[]byte类型
	//c[0] = 'c'      // byte用''单引号包括字符 不然报错cannot use "c" (type string) as type byte in assignment
	c[0] = c     // byte用''单引号包括字符 不然报错cannot use "c" (type string) as type byte in assignment
	s2 := string(c) // 再转为string类型
	fmt.Printf("%s\n", s2)
}